#include "my_vector.h"
#include <cassert>  //断言宏assert

template<typename T>
class my_stack {
private:
    my_vector<T> vector;
public:
    void push(const T& t){
        vector.push_back(t);
    }
    void pop(){
        assert(!vector.empty());
        vector.erase(vector.end());
    }
    T& top(){   //查看栈顶元素
        assert(!vector.empty());
        return vector[vector.size() -1];
    }
    size_t size(){
        return vector.size();
    }
    
    
    bool empty(){
        return vector.empty();
    }
};